import React, { Component } from 'react'
import Top from "./top"
import Bottom from './bottom'
import axios from 'axios'
class Tab extends Component {
    state={
        arr:[]
    }
    componentDidMount(){
        axios.get("/list1").then(res=>{
            console.log(res.data);
            this.setState({
                arr:res.data
            })
        })
    }
    render() {
        return (
            <div>
                {
                    this.state.arr&& this.state.arr.length?<Top send={this.state.arr}></Top>:""
                }
                
                {
                    this.state.arr&& this.state.arr.length? <Bottom send={this.state.arr}></Bottom>:""
                }
               
            </div>
        )
    }
}

export default Tab
